/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ADMIN
 */
@Entity
@Table(name = "cajero", catalog = "SIESCO", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cajero.findAll", query = "SELECT c FROM Cajero c"),
    @NamedQuery(name = "Cajero.findByIdcajero", query = "SELECT c FROM Cajero c WHERE c.idcajero = :idcajero"),
    @NamedQuery(name = "Cajero.findByIdtienda", query = "SELECT c FROM Cajero c WHERE c.idtienda = :idtienda"),
    @NamedQuery(name = "Cajero.findByNombrecajero", query = "SELECT c FROM Cajero c WHERE c.nombrecajero = :nombrecajero")})
public class Cajero implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "idcajero", nullable = false)
    private Integer idcajero;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idtienda", nullable = false)
    private int idtienda;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nombrecajero", nullable = false, length = 50)
    private String nombrecajero;

    public Cajero() {
    }

    public Cajero(Integer idcajero) {
        this.idcajero = idcajero;
    }

    public Cajero(Integer idcajero, int idtienda, String nombrecajero) {
        this.idcajero = idcajero;
        this.idtienda = idtienda;
        this.nombrecajero = nombrecajero;
    }

    public Integer getIdcajero() {
        return idcajero;
    }

    public void setIdcajero(Integer idcajero) {
        this.idcajero = idcajero;
    }

    public int getIdtienda() {
        return idtienda;
    }

    public void setIdtienda(int idtienda) {
        this.idtienda = idtienda;
    }

    public String getNombrecajero() {
        return nombrecajero;
    }

    public void setNombrecajero(String nombrecajero) {
        this.nombrecajero = nombrecajero;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcajero != null ? idcajero.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cajero)) {
            return false;
        }
        Cajero other = (Cajero) object;
        if ((this.idcajero == null && other.idcajero != null) || (this.idcajero != null && !this.idcajero.equals(other.idcajero))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Cajero[ idcajero=" + idcajero + " ]";
    }
    
}
